import request, {
    Method
} from '@/plugins/request.js';
import { get } from 'psl';
// index ---->xp
// 商品列表 
export function goodsList(data) {
    return request({
        url: '/api/xp/goods',
        method: Method.POST,
        needToken: false,
        headers: {'Content-Type': 'application/json'},
        data
    });
}

// 商品分类 筛选条件  品牌， 尺寸等
export function filterList(data) {
    return request({
        url: '/api/xp/filterList',
        method: Method.POST,
        needToken: false,
        headers: {'Content-Type': 'application/json'},
        data
    });
}
// 获取用户的昵称
// export function longinName(data) {
//     return request({
//         url: '/admin/dashboard/brand',
//         method:  Method.GET,
//         // needToken: false,
//         // headers: {'Content-Type': 'application/json'},
//         // data
//     });
// }
// id获取商品详情
export function goodsDetail(data) {
    return request({
        url: `/api/index/goodsdetail`,
        method: Method.POST,
        headers: {'Content-Type': 'application/json'},
        needToken: false,
        data
    });
}

// id获取商品Sku详情
export function goodsSkuDetail(data) {
    return request({
        url: `/api/index/goodsdetail`,
        method: Method.POST,
        headers: {'Content-Type': 'application/json'},
        needToken: false,
        data
    });
}

// 获取所有商品分类
export function getCategory(data) {
    return request({
        url: `/api/index/category`,
        method: Method.POST,
        headers: {'Content-Type': 'application/json'},
        needToken: false,
        data
    });
}

// 获取商品标签
export function getGoodsLabel(data) {
    return request({
        url: `/api/xp/goodslabel`,
        method: Method.POST,
        headers: {'Content-Type': 'application/json'},
        needToken: false,
        data
    });
}

// 当前拼团活动未成团会员
export function pintuanMembers(pintuanId) {
    return request({
        url: `/buyer/promotion/pintuan/${pintuanId}/members`,
        method: Method.GET,
        needToken: false
    });
}

/**
 * 获取搜索热词
 * @param {Number} count 获取搜索热词数量
 */
export function hotWords(params) {
    return request({
        url: `/buyer/goods/goods/hot-words`,
        method: Method.GET,
        needToken: false,
        params
    });
}
